import service from '../../../browser/msg/service';

/**
 * 生成微信公众号带参数二维码
 * @param token 微信token
 * @param scene_str 附带参数
 * @example qrcode(token, scene_str);
 */
export default async function qrcode(token: string, scene_str: string) {
	const msg = {
		accessToken: token,
		serviceflag: 'accountnumberservice',
		subactionflag: 'getTicket',
		ticketPara: {
			action_info: {
				scene: {
					scene_str: '{' + scene_str + '}'
				}
			},
			action_name: 'QR_LIMIT_STR_SCENE'
		}
	};
	return await service<string>('thirdpart.weixinpublicno', msg, false, false);
}
